import { MockMethod } from 'vite-plugin-mock'

export default [
  {
    url: '/api/user/online',
    method: 'get',
    response: ({ query }) => {
      return {
        code: 10000,
        message: 'success',
        data: {
          id: 1,
          username: 'catchadmin',
          password: '$2y$10$QbkZSwRSOstvYa7uhTV14.ifTMe7/W6YDpcrlUnSgmuf0TP3EUdjO',
          email: 'catch@admin.com',
          avatar: 'http://127.0.0.1:8001/uploads/image/2023-02-21/2023DKFUUOe8GI1676960316.png',
          remember_token: null,
          department_id: 0,
          creator_id: 1,
          status: 1,
          login_ip: '172.17.0.1',
          login_at: 1678758571,
          created_at: '2023-02-21 01:44',
          updated_at: '2023-03-14 01:49',
          permissions: [
            {
              id: 1,
              parent_id: 0,
              permission_name: '权限管理',
              route: '/permission',
              icon: 'arrow-down-on-square-stack',
              module: 'permissions',
              permission_mark: '',
              component: '/admin/layout/index.vue',
              redirect: null,
              keepalive: 1,
              type: 1,
              hidden: false,
              sort: 1,
              active_menu: '',
              creator_id: 0,
              created_at: '2022-12-09 09:58',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 2,
              parent_id: 1,
              permission_name: '角色管理',
              route: 'roles',
              icon: 'arrow-left-circle',
              module: 'permissions',
              permission_mark: 'Roles',
              component: '/permission/roles/index.vue',
              redirect: null,
              keepalive: 1,
              type: 2,
              hidden: false,
              sort: 6,
              active_menu: '',
              creator_id: 0,
              created_at: '2022-12-09 09:59',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 3,
              parent_id: 2,
              permission_name: '列表',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Roles@index',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 1,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 09:00',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 4,
              parent_id: 2,
              permission_name: '新增',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Roles@store',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 2,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 09:00',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 5,
              parent_id: 2,
              permission_name: '读取',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Roles@show',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 3,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 09:00',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 6,
              parent_id: 2,
              permission_name: '更新',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Roles@update',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 4,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 09:00',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 7,
              parent_id: 2,
              permission_name: '删除',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Roles@destroy',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 5,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 09:00',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 8,
              parent_id: 1,
              permission_name: '菜单管理',
              route: 'permissions',
              icon: 'finger-print',
              module: 'permissions',
              permission_mark: 'Permissions',
              component: '/permission/permissions/index.vue',
              redirect: null,
              keepalive: 1,
              type: 2,
              hidden: false,
              sort: 1,
              active_menu: '',
              creator_id: 0,
              created_at: '2022-12-10 03:02',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 9,
              parent_id: 8,
              permission_name: '列表',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Permissions@index',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 1,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 08:25',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 10,
              parent_id: 8,
              permission_name: '新增',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Permissions@store',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 2,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 08:25',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 11,
              parent_id: 8,
              permission_name: '读取',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Permissions@show',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 3,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 08:25',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 12,
              parent_id: 8,
              permission_name: '更新',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Permissions@update',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 4,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 08:25',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 13,
              parent_id: 8,
              permission_name: '删除',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Permissions@destroy',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 5,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 08:25',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 14,
              parent_id: 8,
              permission_name: '禁用/启用',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Permissions@enable',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 6,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 08:25',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 15,
              parent_id: 1,
              permission_name: '岗位管理',
              route: 'jobs',
              icon: 'globe-americas',
              module: 'permissions',
              permission_mark: 'Jobs',
              component: '/permission/jobs/index.vue',
              redirect: null,
              keepalive: 1,
              type: 2,
              hidden: false,
              sort: 1,
              active_menu: '',
              creator_id: 0,
              created_at: '2022-12-10 03:03',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 16,
              parent_id: 15,
              permission_name: '列表',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Jobs@index',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 1,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 08:25',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 17,
              parent_id: 15,
              permission_name: '新增',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Jobs@store',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 2,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 08:25',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 18,
              parent_id: 15,
              permission_name: '读取',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Jobs@show',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 3,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 08:25',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 19,
              parent_id: 15,
              permission_name: '更新',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Jobs@update',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 4,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 08:25',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 20,
              parent_id: 15,
              permission_name: '删除',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Jobs@destroy',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 5,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 08:25',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 21,
              parent_id: 15,
              permission_name: '禁用/启用',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Jobs@enable',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 6,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 08:25',
              updated_at: '2023-01-04 02:08'
            },
            {
              id: 22,
              parent_id: 1,
              permission_name: '部门管理',
              route: 'departments',
              icon: 'table-cells',
              module: 'permissions',
              permission_mark: 'Departments',
              component: '/permission/departments/index.vue',
              redirect: null,
              keepalive: 1,
              type: 2,
              hidden: false,
              sort: 1,
              active_menu: '',
              creator_id: 0,
              created_at: '2022-12-10 03:03',
              updated_at: '2023-02-23 01:58'
            },
            {
              id: 23,
              parent_id: 22,
              permission_name: '列表',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Departments@index',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 1,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 02:04',
              updated_at: '2023-02-23 01:58'
            },
            {
              id: 24,
              parent_id: 22,
              permission_name: '新增',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Departments@store',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 1,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 02:04',
              updated_at: '2023-02-23 01:58'
            },
            {
              id: 25,
              parent_id: 22,
              permission_name: '读取',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Departments@show',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 1,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 02:04',
              updated_at: '2023-02-23 01:58'
            },
            {
              id: 26,
              parent_id: 22,
              permission_name: '更新',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Departments@update',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 1,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 06:21',
              updated_at: '2023-02-23 01:58'
            },
            {
              id: 27,
              parent_id: 22,
              permission_name: '删除',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Departments@destroy',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 1,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 06:22',
              updated_at: '2023-02-23 01:58'
            },
            {
              id: 28,
              parent_id: 22,
              permission_name: '禁用/启用',
              route: '',
              icon: '',
              module: 'permissions',
              permission_mark: 'Departments@enable',
              component: '',
              redirect: '',
              keepalive: 1,
              type: 3,
              hidden: false,
              sort: 6,
              active_menu: '',
              creator_id: 1,
              created_at: '2022-12-20 08:21',
              updated_at: '2023-02-23 01:58'
            }
          ],
          roles: [],
          jobs: []
        }
      }
    }
  },
  {
    url: '/api/options/status',
    method: 'get',
    response: ({ query }) => {
      return {
        code: 10000,
        message: 'success',
        data: [
          {
            label: '启用',
            value: 1
          },
          {
            label: '禁用',
            value: 2
          }
        ]
      }
    }
  },
  {
    url: '/api/users',
    method: 'get',
    response: ({ query }) => {
      return {
        code: 10000,
        message: 'success',
        data: [
          {
            avatar: 'http://127.0.0.1:8001/uploads/image/2023-02-21/2023DKFUUOe8GI1676960316.png',
            created_at: '2023-02-21 01:44',
            creator: 'catchadmin',
            creator_id: 1,
            department_id: 0,
            email: 'catch@admin.com',
            id: 1,
            jobs: [],
            login_at: 1678695765,
            login_ip: '172.17.0.1',
            password: '$2y$10$QbkZSwRSOstvYa7uhTV14.ifTMe7/W6YDpcrlUnSgmuf0TP3EUdjO',
            remember_token: null,
            roles: [],
            status: 1,
            updated_at: '2023-03-13 08:22',
            username: 'catchadmin'
          }
        ]
      }
    }
  },
  {
    url: '/api/user/login/log',
    method: 'get',
    response: ({ query }) => {
      return {
        code: 10000,
        message: 'success',
        limit: 10,
        page: 1,
        total: 10,
        data: [
          {
            id: 95,
            account: 'catch@admin.com',
            login_ip: '172.17.0.1',
            browser: 'Chrome',
            platform: 'Mac OS',
            login_at: '2023-03-13 16:22',
            status: 1
          }
        ]
      }
    }
  },
  {
    url: '/api/user/operate/log',
    method: 'get',
    response: ({ query }) => {
      return {
        code: 10000,
        message: 'success',
        limit: 10,
        page: 1,
        total: 10,
        data: [
          {
            id: 5024,
            module: 'user',
            action: 'user@online',
            params: '[]',
            ip: '172.17.0.1',
            http_method: 'GET',
            http_code: 200,
            start_at: 1678696352,
            time_taken: '176ms',
            creator_id: 1,
            created_at: 1678696353,
            creator: 'catchadmin'
          }
        ]
      }
    }
  }
] as MockMethod[]
